package cn.jianyongjie.system.mapper;

import cn.jianyongjie.system.domain.Role;
import cn.jianyongjie.basic.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jianyongjie
 * @since 2022-05-13
 */
public interface RoleMapper extends BaseMapper<Role> {


    /*
     * @Title: RoleMapper
     * @Description: 删除中间表以前的数据
     * @Author: JianYongJie
     * @Version: 1.0
     * @Date:  2022/5/15 17:58
     * @Parameters: * @param id
     * @Return void
     */
    void removeByRoleMenuId(Long id);

    /*
    * @Title: RoleMapper
    * @Description: 删除中间表以前的数据
    * @Author: JianYongJie
    * @Version: 1.0
    * @Date:  2022/5/15 17:58
    * @Parameters: * @param id
    * @Return void
    */
    void removeByRolePermissionId(Long id);


    /*
    * @Title: RoleMapper
    * @Description: 新增t_role_menu中间表
    * @Author: JianYongJie
    * @Version: 1.0
    * @Date:  2022/5/15 17:57
    * @Parameters: * @param id
     * @param menus
    * @Return void
    */
    void saveRoleMenu(@Param("mid") Long id,@Param("menus") List<Long> menus);

    /*
    * @Title: RoleMapper
    * @Description: 新增t_role_permission中间表
    * @Author: JianYongJie
    * @Version: 1.0
    * @Date:  2022/5/15 17:58
    * @Parameters: * @param role
     * @param permissions
    * @Return void
    */
    void saveRolePermission(@Param("mid") Long id,@Param("permissions") List<Long> permissions);
}
